#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>


int main()
{
	char ch[10] = "0";
	gets(ch);
	int len = strlen(ch);
	int count = 0;
	for (int i = 0; i < len; i++)
	{
		if (ch[i] != ' ' && ch[i] != '\n')
		{
			count++;
		}
	}
	printf("%d", count);
	return 0;
}